package http

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func RequestDemo() {

	url := "/trade/sales?buyerId=17&nextCursor=0&pageSize=10"
	method := "GET"

	client := &http.Client{}
	req, err := http.NewRequest(method, url, nil)

	if err != nil {
		fmt.Println(err)
		return
	}
	req.Header.Add("X-Time", "1714988415887")
	req.Header.Add("X-Token", "026823aVFGJUbWiIshgBN+HRqc8z3VoNo5F5ouwrnbKsiGhw1UyoMTLl6nOcSTSjRaM1Jq01nu17wzg837h5wzPUVRk4oPxThPwAYF")
	req.Header.Add("X-Uid", "65832")
	req.Header.Add("User-Agent", "Apifox/1.0.0 (https://apifox.com)")

	res, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer res.Body.Close()

	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(string(body))
}
